package com.jack.charging.user.controller;

import com.jack.charging.common.pojo.JsonResult;
import com.jack.charging.user.pojo.vo.UserInfoVO;
import com.jack.charging.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jack
 * @date 2025/2/8 09:58
 * @see
 * @since
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户模块")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;
    @ApiOperation(value = "获取用户信息")
    @GetMapping(value = "/info/{userId}")
    public JsonResult<UserInfoVO> getUserInfo(@PathVariable("userId") Integer userId) {
        log.info("获取用户信息，userId:{}", userId);
        return JsonResult.ok(userService.getUserInfo(userId), "获取用户信息成功");
    }

}
